package cn.lg.soar.system.feign;

import cn.lg.soar.core.annotations.ApiClient;
import cn.lg.soar.system.api.constant.ModuleConst;
import cn.lg.soar.system.api.service.ISysConfigApi;
import cn.lg.soar.system.feign.fallback.TenantConfigApiFallbackFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author luguoxiang
 * @date 2021-08-11
 * 配置接口
 */
@ConditionalOnMissingClass("cn.lg.soar.system.biz.modules.tenant.client.TenantConfigApiClient")
@ApiClient
@FeignClient(
        name= ModuleConst.MODULE_NAME,
        path= ModuleConst.CLIENT_PATH + "/tenant/config",
        fallbackFactory= TenantConfigApiFallbackFactory.class,
        contextId = "TenantConfigApiFeign"
)
public interface TenantConfigApiFeign extends ISysConfigApi {

    @GetMapping("get")
    @Override
    String get(@RequestParam("code") String code);

    @PostMapping("set")
    @Override
    boolean set(@RequestParam("code") String code, @RequestParam("value") String value);

}
